//
//  TagPickerDataSource.m
//  MoneyBook
//
//  Created by Justin Kim on 11. 6. 28..
//  Copyright 2011 Daum. All rights reserved.
//

#import "TagPickerDataSource.h"
#import "SQLHandler.h"

@implementation TagPickerDataSource

@synthesize tagPickerArray = _tagPickerArray;


/////////////////////////////////////////////////////////////////////////////////////////////////
- (id)init{
	self = [super init];
	if (self){
        self.tagPickerArray = [[SQLHandler sharedInstance] findAllTag];
    }
    return self;
}

/////////////////////////////////////////////////////////////////////////////////////////////////
- (void)dealloc{
	[_tagPickerArray release];
	
    [super dealloc];
}

#pragma mark -
#pragma mark UIPickerViewDataSource
/////////////////////////////////////////////////////////////////////////////////////////////////
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    //    NSLog(@"numberOfRowsInComponent");
    return [_tagPickerArray count];
}

/////////////////////////////////////////////////////////////////////////////////////////////////
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    //    NSLog(@"numberOfComponentsInPickerView");
    return 1;
}
-(void)reloadData{
    self.tagPickerArray = [[SQLHandler sharedInstance] findAllTag];
}

@end
